import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home'
    // redirect: '/admin'
  },
  // 管理管理员
  {
    path: '/admin',
    name: 'Admin',
    component: () => import('@/views/admin/admin.vue'),
    redirect: { name: 'AdminHome' },
    children: [
      {
        path: 'admin-home',
        name: 'AdminHome',
        component: () => import('@/views/admin/home.vue'),
        meta: { title: '门店' }
      },
      {
        path: 'orderView',
        name: 'OrderView',
        component: () => import('@/views/admin/orderView.vue'),
        meta: { title: '订单' }
      },
      {
        path: 'myCenter',
        name: 'MyCenter',
        component: () => import('@/views/admin/myCenter.vue'),
        meta: { title: '个人中心' }
      },
      {
        path: 'shopAssistant',
        name: 'ShopAssistant',
        component: () => import('@/views/admin/shopAssistant/list.vue'),
        meta: { title: '门店营业员' }
      },
      {
        path: 'shopAssistant-add',
        name: 'ShopAssistant-add',
        component: () => import('@/views/admin/shopAssistant/add.vue'),
        meta: { title: '门店营业员-添加' }
      },
      {
        path: 'shopAssistant-QRcode',
        name: 'ShopAssistant-QRcode',
        component: () => import('@/views/admin/shopAssistant/QRcode.vue'),
        meta: { title: '门店营业员-二维码' }
      },
      {
        path: 'peopleInfo',
        name: 'PeopleInfo',
        component: () => import('@/views/admin/peopleInfo/info.vue'),
        meta: { title: '个人资料' }
      },
      {
        path: 'editName',
        name: 'EditName',
        component: () => import('@/views/admin/peopleInfo/editName.vue'),
        meta: { title: '编辑用户' }
      },
      {
        path: 'editPhone',
        name: 'EditPhone',
        component: () => import('@/views/admin/peopleInfo/editPhone.vue'),
        meta: { title: '修改手机号' }
      },
      {
        path: 'verifyPhone',
        name: 'VerifyPhone',
        component: () => import('@/views/admin/peopleInfo/verifyPhone.vue'),
        meta: { title: '原手机验证码' }
      },
      {
        path: 'bindingPhone',
        name: 'BindingPhone',
        component: () => import('@/views/admin/peopleInfo/bindingPhone.vue'),
        meta: { title: '绑定新手机' }
      },
      {
        path: 'bindingVerify',
        name: 'BindingVerify',
        component: () => import('@/views/admin/peopleInfo/bindingVerify.vue'),
        meta: { title: '新手机校验' }
      },
      {
        path: 'markeingQR',
        name: 'MarkeingQR',
        component: () => import('@/views/admin/markeingQR.vue'),
        meta: { title: '营销二维码' }
      },
      {
        path: 'statisticChart',
        name: 'StatisticChart',
        component: () => import('@/views/admin/statisticChart.vue'),
        meta: { title: '运营统计' }
      }
      // {
      //   path: 'storeArder',
      //   name: 'storeArder',
      //   component: () => import('@/views/admin/storeArder/storeArder.vue'),
      //   meta: { title: '门店订单' }

      // },
      // {
      //   path: 'storeDetail',
      //   name: 'storeDetail',
      //   component: () => import('@/views/admin/storeArder/storeDetail.vue'),
      //   meta: {
      //     title: '订单详情'
      //   }
      // },
      // {
      //   path: 'storeSearch',
      //   name: 'storeSearch',
      //   component: () => import('@/views/admin/storeArder/storeSerach.vue'),
      //   meta: {
      //     title: '搜索'
      //   }
      // },
      // {
      //   path: 'storeFilter',
      //   name: 'storeFilter',
      //   component: () => import('@/views/admin/storeArder/storeFilter.vue'),
      //   meta: {
      //     title: '筛选'
      //   }
      // }
      // // {
      // //   path: 'addStore',
      // //   name: 'addstore',
      // //   component: () => import('@/views/admin/addStore.vue'),
      // //   meta: {
      // //     title: '新增门店'
      // //   }
      // // }

    ]
  },
  // 营业员

  {
    path: '/shopAssistant',
    // name: 'ShopAssistant',
    component: () => import('@/views/shopAssistant/index.vue'),
    redirect: { name: 'shopAssistantHome' },
    children: [
      {
        path: 'shopAssistant-home',
        name: 'shopAssistantHome',
        component: () => import('@/views/shopAssistant/home.vue'),
        meta: { title: '门店' }
      },
      {
        path: 'orderView',
        name: 's-OrderView',
        component: () => import('@/views/shopAssistant/orderView.vue'),
        meta: { title: '订单' }
      },
      {
        path: 'myCenter',
        name: 's-MyCenter',
        component: () => import('@/views/shopAssistant/myCenter.vue'),
        meta: { title: '个人中心' }
      },

      {
        path: 'peopleInfo',
        name: 's-PeopleInfo',
        component: () => import('@/views/shopAssistant/peopleInfo/info.vue'),
        meta: { title: '个人资料' }
      },
      {
        path: 'editName',
        name: 's-EditName',
        component: () => import('@/views/shopAssistant/peopleInfo/editName.vue'),
        meta: { title: '编辑用户' }
      },
      {
        path: 'editPhone',
        name: 's-EditPhone',
        component: () => import('@/views/shopAssistant/peopleInfo/editPhone.vue'),
        meta: { title: '修改手机号' }
      },
      {
        path: 'verifyPhone',
        name: 's-VerifyPhone',
        component: () => import('@/views/shopAssistant/peopleInfo/verifyPhone.vue'),
        meta: { title: '原手机验证码' }
      },
      {
        path: 'bindingPhone',
        name: 's-BindingPhone',
        component: () => import('@/views/shopAssistant/peopleInfo/bindingPhone.vue'),
        meta: { title: '绑定新手机' }
      },
      {
        path: 'bindingVerify',
        name: 's-BindingVerify',
        component: () => import('@/views/shopAssistant/peopleInfo/bindingVerify.vue'),
        meta: { title: '新手机校验' }
      },
      {
        path: 'markeingQR',
        name: 's-MarkeingQR',
        component: () => import('@/views/shopAssistant/markeingQR.vue'),
        meta: { title: '营销二维码' }
      },
      {
        path: 'wishlist',
        name: 's-Wishlist',
        component: () => import('@/views/shopAssistant/wishlist/list.vue'),
        meta: { title: '意向单' }
      },
      {
        path: 'processing',
        name: 's-Processing',
        component: () => import('@/views/shopAssistant/wishlist/processing.vue'),
        meta: { title: '意向单办理中' }
      },
      {
        path: 'processResult',
        name: 's-ProcessResult',
        component: () => import('@/views/shopAssistant/wishlist/processResult.vue'),
        meta: { title: '意向单结果' }
      }
    ]
  },
  // 个人
  {
    path: '/personal',
    name: 'Personal',
    component: () => import('@/views/personal/personal.vue'),
    redirect: { name: 'PersonalHome' },
    children: [
      {
        path: 'personal-home',
        name: 'PersonalHome',
        component: () => import('@/views/personal/home.vue'),
        meta: { title: '门店' }
      },
      {
        path: 'orderView',
        name: 'p-OrderView',
        component: () => import('@/views/personal/orderView.vue'),
        meta: { title: '订单' }
      },
      {
        path: 'myCenter',
        name: 'p-MyCenter',
        component: () => import('@/views/personal/myCenter.vue'),
        meta: { title: '个人中心' }
      },

      {
        path: 'peopleInfo',
        name: 'p-PeopleInfo',
        component: () => import('@/views/personal/peopleInfo/info.vue'),
        meta: { title: '个人资料' }
      },

      {
        path: 'QRcode',
        name: 'p-QRcode',
        component: () => import('@/views/personal/QRcode.vue'),
        meta: { title: '二维码生成' }
      },
      {
        path: 'wishlist',
        name: 'p-Wishlist',
        component: () => import('@/views/personal/wishlist/list.vue'),
        meta: { title: '意向单' }
      },
      {
        path: 'processing',
        name: 'p-Processing',
        component: () => import('@/views/personal/wishlist/processing.vue'),
        meta: { title: '意向单办理中' }
      },
      {
        path: 'processResult',
        name: 'p-ProcessResult',
        component: () => import('@/views/personal/wishlist/processResult.vue'),
        meta: { title: '意向单结果' }
      },
      {
        path: 'distributor',
        name: 'p-distributor',
        meta: { title: '渠道商' }
      }

    ]
  },

  // 渠道商
  {
    path: '/channel',
    name: 'Channel',
    component: () => import('@/views/channel/index.vue'),
    redirect: { name: 'ChannelHome' },
    children: [
      {
        path: 'channel-home',
        name: 'ChannelHome',
        component: () => import('@/views/channel/home.vue'),
        meta: { title: '门店查看' }
      },
      {
        path: 'address',
        name: 'c-Address',
        component: () => import('@/views/channel/address.vue'),
        meta: { title: '筛选门店' }
      },

      {
        path: 'myCenter',
        name: 'c-MyCenter',
        component: () => import('@/views/channel/myCenter.vue'),
        meta: { title: '个人中心' }
      },
      {
        path: 'shopAssistant',
        name: 'c-ShopAssistant',
        component: () => import('@/views/channel/shopAssistant/list.vue'),
        meta: { title: '门店营业员' }
      },
      {
        path: 'shopAssistant-add',
        name: 'c-ShopAssistant-add',
        component: () => import('@/views/channel/shopAssistant/add.vue'),
        meta: { title: '门店营业员-添加' }
      },
      {
        path: 'shopAssistant-QRcode',
        name: 'c-ShopAssistant-QRcode',
        component: () => import('@/views/channel/shopAssistant/QRcode.vue'),
        meta: { title: '生成二维码' }
      },
      {
        path: 'peopleInfo',
        name: 'c-PeopleInfo',
        component: () => import('@/views/channel/peopleInfo/info.vue'),
        meta: { title: '个人资料' }
      },
      {
        path: 'storeChart',
        name: 'c-StoreChart',
        component: () => import('@/views/channel/storeChart.vue'),
        meta: { title: '门店推广' }
      },

      {
        path: 'markeingQR',
        name: 'c-MarkeingQR',
        component: () => import('@/views/channel/markeingQR.vue'),
        meta: { title: '生成维码' }
      },
      {
        path: 'addStore',
        name: 'c-addstore',
        component: () => import('@/views/channel/addStore.vue'),
        meta: {
          title: '新增门店'
        }
      },
      {
        path: 'statisticChart',
        name: 'c-StatisticChart',
        component: () => import('@/views/channel/statisticChart.vue'),
        meta: { title: '运营统计' }
      },
      {
        path: 'storeArder',
        name: 'c-storeArder',
        component: () => import('@/views/channel/storeArder/storeArder.vue'),
        meta: { title: '门店订单' }

      },
      {
        path: 'storeDetail',
        name: 'c-storeDetail',
        component: () => import('@/views/channel/storeArder/storeDetail.vue'),
        meta: {
          title: '订单详情'
        }
      },
      {
        path: 'storeSearch',
        name: 'c-storeSearch',
        component: () => import('@/views/channel/storeArder/storeSerach.vue'),
        meta: {
          title: '搜索'
        }
      },
      {
        path: 'storeFilter',
        name: 'c-storeFilter',
        component: () => import('@/views/channel/storeArder/storeFilter.vue'),
        meta: {
          title: '筛选'
        }
      }

    ]
  },

  {
    path: '*',
    name: 'NotFount',
    component: () => import('@/views/notFount.vue'),
    meta: { title: '404页面' }
  }
]

const router = new VueRouter({
  routes
})

export default router
